Skip to content

Document and test maximum deriveBits length for ECDH curves - #289

Merged
mosuem merged 1 commit into
google:masterfrom
Syed-Moiz-Ali:feat/ecdh-derivebits-docs
Jul 20, 2026
Merged

Document and test maximum deriveBits length for ECDH curves#289
mosuem merged 1 commit into
google:masterfrom
Syed-Moiz-Ali:feat/ecdh-derivebits-docs

Conversation

@Syed-Moiz-Ali

@Syed-Moiz-Ali Syed-Moiz-Ali commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #130

Updates EcdhPrivateKey.deriveBits documentation to specify the maximum number of bits that can be derived for each supported elliptic curve:

  • EllipticCurve.p256 — up to 256 bits
  • EllipticCurve.p384 — up to 384 bits
  • EllipticCurve.p521 — up to 528 bits

Also adds test coverage for all three curves at their maximum derive lengths in the ECDH test runner (previously only P-256 with 32 bytes was tested).

Updates documentation on EcdhPrivateKey.deriveBits to include
the maximum number of bits that can be derived for each curve:

  * EllipticCurve.p256 — up to 256 bits
  * EllipticCurve.p384 — up to 384 bits
  * EllipticCurve.p521 — up to 528 bits

Also adds test coverage for all three curves at their maximum
derive lengths in the ECDH test runner.

Fixes google#130
@google-cla

google-cla Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mosuem
mosuem merged commit 62eb38a into google:master Jul 20, 2026
5 checks passed
HamdaanAliQuatil added a commit that referenced this pull request Jul 24, 2026
* Move Flutter demo app into example/webcrypto_demo_flutter_app/ (#284)

* refactor: move Flutter demo app into example/webcrypto_demo_flutter_app/ (#283)

* chore: fix references to the relocated example app (#283)

* chore: ignore unknown dartdoc example directive (#294)

* refactor: replace runtime symbol lookup with direct FFI  bindings (#279)

* refactor: replace runtime symbol lookup with direct FFI  bindings

* refactor: replace runtime symbol lookup with direct FFI
  bindings

* refactor: generate direct FFI bindings with ffigen

* refactor: remove stale symbol table files

* refactor: use Native.addressOf for EVP_PKEY finalizer

* Reject imported EC and RSA keys with trailing bytes (#251)

* Reject imported EC and RSA keys with trailing bytes

* Add regression tests for issue 60 (trailing bytes in key imports)

* Finalize regression tests for issue 60: hardcoded keys and browser compatibility

* Update lib/src/testing/regression/issue_60_trailing_bytes.dart

Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com>

* Update lib/src/testing/regression/issue_60_trailing_bytes.dart

Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com>

* Fix trailing bytes regression fixture

* Minimize trailing bytes fixture diff

* Fix trailing bytes regression on web wasm

* fix: FFI key import memory leaks and make trailing bytes tests

---------

Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com>

* ci: add FFI memory-safety test lane (#295)

* ci: add FFI memory-safety test lane

* test: separate Valgrind runner from FFI workload

* ci: run Valgrind in existing Linux job

* refactor(js): fix JSDomException checks for wasm compatibility (#306)

* refactor(js): fix JSDomException checks for wasm compatibility

Resolve invalid_runtime_check_with_js_interop_types warnings for JSDomException.

Instead of directly catching the extension type JSDomException or checking e is JSObject, we catch generic objects, cast them to JSAny?, and check if they are JSDomException instances using isA<subtle.JSDomException>().

This avoids platform-inconsistent runtime checks that behave incorrectly under dart2wasm where extension types are runtime-erased.

* fix libraries

* refactor(js): fix JSDomException type-checking crash under WASM

Resolve _TypeError when casting generic exceptions to JSAny? under dart2wasm.

* fix(testing): wire AES-GCM tagLength vectors (#312)

* Fix AES-CTR large chunk handling (#309)

* fix(aes-ctr): handle partial chunks larger than buffer

* test(aes-ctr): refine large chunk coverage

* fix(derive-bits): support zero-length results (#321)

* docs: update RFC links to use the official RFC editor URLs (#245)

Co-authored-by: Moritz <27859082+mosuem@users.noreply.github.com>

* docs: move HMAC importRawKey example to file (#293)

* chore: mark unsupported code paths with coverage:ignore (#327)

* chore: mark unsupported code paths with coverage:ignore

* test: mark impl_stub as coverage:ignore-file

* test: ignore unreachable curve fallbacks in EC helpers

* docs: correct JWK use value for AES keys (#330)

* correct JWK use value for AES keys

* correct JWK use value for AES keys

* correct JWK use value for AES keys

* Document maximum deriveBits length for ECDH curves (#289)

Updates documentation on EcdhPrivateKey.deriveBits to include
the maximum number of bits that can be derived for each curve:

  * EllipticCurve.p256 — up to 256 bits
  * EllipticCurve.p384 — up to 384 bits
  * EllipticCurve.p521 — up to 528 bits

Also adds test coverage for all three curves at their maximum
derive lengths in the ECDH test runner.

Fixes #130

* Upgrade native_toolchain_cmake to v0.3 (#336)

This new version improves Android SDK detection:
rainyl/native_toolchain_cmake#31

* fix: use canonical RSA-OAEP JWK alg for SHA-1 (#337)

---------

Co-authored-by: Samar Borkar <128998523+Samarborkar@users.noreply.github.com>
Co-authored-by: Musharaf Khan Pathan <135562339+Apple-beep@users.noreply.github.com>
Co-authored-by: HamdaanAliQuatil <96776914+HamdaanAliQuatil@users.noreply.github.com>
Co-authored-by: Harshita Yadav <seemayadavanuj123@gmail.com>
Co-authored-by: Jonas Finnemann Jensen <jopsen@gmail.com>
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
Co-authored-by: Berkay Çatak <34205493+berkaycatak@users.noreply.github.com>
Co-authored-by: Moritz <27859082+mosuem@users.noreply.github.com>
Co-authored-by: AquibAquil <96966923+AquibAquil@users.noreply.github.com>
Co-authored-by: w1boost1889M <63419938+w1boost1889M@users.noreply.github.com>
Co-authored-by: Syed Moiz Ali <100577359+Syed-Moiz-Ali@users.noreply.github.com>
Co-authored-by: Simon Ser <contact@emersion.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the maximum length in EcdhPrivateKey.deriveBits for each curve

2 participants